package com.jiyun.orders.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor //全参构造
@NoArgsConstructor //无参构造
public class ResultVo {
    private int code;
    private String msg;

    private Object data;

    public ResultVo(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResultVo ok(){
        return new ResultVo(1,"success");
    }
    public static ResultVo ok(Object data){
        return new ResultVo(1,"success",data);
    }
    public static ResultVo error(String msg){
        return new ResultVo(0,msg);
    }
}
